home *** CD-ROM | disk | FTP | other *** search
Wrap
function makeButtonShield() { var clp = this.createEmptyMovieClip("mc_button_shield",Tardis.depth++); var clpHA = clp.createEmptyMovieClip("mc_hitarea",Tardis.depth++); var w = 250; var h = 50; clpHA.moveTo(0,0); clpHA.beginFill(16711680); clpHA.lineTo(w,0); clpHA.lineTo(w,h); clpHA.lineTo(0,h); clpHA.lineTo(0,0); clpHA.endFill(); clp._x = _xmouse - w / 2; clp._y = _ymouse - h / 2; clp.hitArea = clpHA; clp.onRollOut = function() { this.mc_hitarea.removeMovieClip(); this.removeMovieClip(); }; clpHA._visible = false; } function splashRestart() { if(ActiveSection == null) { trace("restart her"); Tardis.splash.startSoundLoop(); return undefined; } LastSection = ActiveSection; ActiveSection = null; bottomNav.show(); bottomNav.clearActive(); bottomNav.fadeOthers("","up"); footer.sponsorButtonShow(); if(ActiveItem != null) { LastItem = ActiveItem; itemExit(); } else if(LastSection.type == "bespoke") { itemExit(); } header.clearUp(); } function webPageOpen(strURL) { if(PLAY_MODE == "browser") { getURL(strURL,""); } else if(ActiveSection.confirmweb != null) { lingo("Flsh_openWebPageConfirm(\"" + strURL + "\")"); } else { lingo("Flsh_openWebPage(\"" + strURL + "\")"); } } function sectionGo() { if(splash.blnAtStart == true) { delete splash.blnAtStart; header.go(ActiveSection.id); sectionLoad(); } else { sectionLoad(); } } function sectionLoad() { LastSection = null; var strID = ActiveSection.id; if(ActiveSection.type == "bespoke") { trace("ActiveSection.type = bespoke"); template.loadBespokeSection(); UsageData.addPageEntry(ActiveSection.index); header.go(ActiveSection.id); } else { sideMenu.onComplete = function() { delete this.onComplete; template.loadModules(); }; template.onDataLoaded = function() { delete this.onDataLoaded; this.loadModules(); }; sideMenu.onReady = function() { this._visible = true; this.onReady = null; if(Shortcut != null) { header.go(ActiveSection.id); Tardis.ActiveItem = this.ItemHome.byPath(Shortcut); if(Tardis.ActiveItem == null) { Tardis.ActiveItem = this.ItemHome; } this.makeChildren(Tardis.ActiveItem); Tardis.itemLoad(); delete Shortcut; } else if(Tardis.ActiveItem == null) { Tardis.ActiveItem = this.ItemHome; Tardis.itemLoad(); } }; sideMenu.make(strID); } if(ActiveSection.hideSponsor == "true") { footer.sponsorButtonHide(); } else { footer.sponsorButtonShow(); } } function sectionExit() { ActiveItem = null; LastItem = null; sideMenu.clearUp(); adverts.clearUp(); if(Shortcut != null) { sectionLoad(); } else if(ActiveSection != null) { sectionGo(); } else { splash.show(); splash.restart(); } } function itemJump(nmSection, strPath) { splash.interrupted = false; var objSectionNew = Sections.item(nmSection); if(overlay.active == true) { template.onReady = function() { Tardis.overlay.close(); this.onReady = null; }; } if(objSectionNew != ActiveSection) { LastSection = ActiveSection; ActiveSection = objSectionNew; Shortcut = strPath; bottomNav.setActive(ActiveSection.id); if(LastSection == null) { sectionLoad(); } else { itemExit(); } } else { ActiveItem = sideMenu.ItemHome.byPath(strPath); sideMenu.makeChildren(ActiveItem); itemLoad(); } } function itemGo(Item) { switch(Item.attributes.type) { case "html": if(Childlock.active == true) { return undefined; } var strURL = Item.attributes.local != "true" ? "" : "assets/html/"; strURL += Item.attributes.file; webPageOpen(strURL); itemLog(Item); break; case "lock": if(Childlock.active != true) { Childlock.lockDialog(); } else { Childlock.unlockDialog(); } break; case "app": itemLog(Item); break; case "shortcut": itemJump(Item.attributes.section,Item.attributes.itemref); break; case "promo": var promoID = Item.attributes.promoid; var obj = {filename:Tardis.Settings.promos[Tardis.ActiveSection.id][promoID].filename,category:Tardis.Settings.promos[Tardis.ActiveSection.id][promoID].category,closeBut:"promo"}; Tardis.OverlayController.addOverlay(obj); var SECTION_NUM = Tardis.ActiveSection.index; var PLAYLIST_NUM = 1; var strLog = SECTION_NUM + "." + PLAYLIST_NUM; var strType = "promo"; Tardis.UsageData.addAdvertEntry(strLog,strType); break; case "semiOverlay": var theXmlFile = Tardis.ASSETS_FOLDER + "xml/content/kids/" + Item.attributes.xmlfile + ".xml"; overlay = new XML(); overlay.ignoreWhite = true; overlay.onLoad = function(success) { if(success) { var cartoon = this.firstChild.firstChild.byName("cartoon"); var f = cartoon.byName("filename"); var c = cartoon.byName("category"); var obj = {filename:f.firstChild.nodeValue,category:c.firstChild.nodeValue,disableLevel:1,strType:"bespoke",closeBut:""}; Tardis.OverlayController.addOverlay(obj); } else { trace("!! XML load failed !!"); } }; overlay.load(theXmlFile); break; default: break; case "template": case "bespoke": LastItem = ActiveItem; ActiveItem = Item; if(LastItem != null) { itemExit(); } else { itemLoad(); } return true; } } function itemLoad() { Tardis.debug.addProcess("loadModules","Tardis : itemLoad()"); sideMenu.onComplete = function() { Tardis.debug.addProcess("loadModules","sideMenu.onComplete()"); Tardis.debug.addProcess("loadModules","load the modules..."); delete this.onComplete; template.loadModules(); }; template.onDataLoaded = function() { delete this.onDataLoaded; this.loadModules(); }; if(ActiveSection.hideSponsor != "true" || ActiveItem.attributes.hideSponsor == "false") { footer.sponsorButtonShow(); } else { footer.sponsorButtonHide(); } template.load(); itemLog(ActiveItem); } function loadAdvertButton() { Tardis.debug.addProcess("loadModules","Tardis.loadAdvertButton()"); Tardis.debug.showProcessPath("loadModules"); Tardis.debug.clearProcessPath("loadModules"); var item_advert = ActiveItem.attributes.advert; var advert_id = item_advert != null ? item_advert : ActiveSection.advert; if(advert_id != adverts.strPlaylistID) { adverts.prepare(advert_id); } } function itemExit() { Tardis.debug.addProcess("clickMainNav","Tardis : itemExit()"); template.exit(); } function itemHide() { if(ActiveItem.attributes.type === "template") { template.hide(); } } function itemShow() { if(ActiveItem.attributes.type === "template") { template.show(); } } function itemLog(Item) { var str = ActiveSection.index; if(Item != sideMenu.ItemHome) { str += sideMenu.arrParentIndex.length <= 0 ? "" : "." + sideMenu.arrParentIndex.join("."); str += Item.firstChild.hasChildNodes() == true ? "" : "." + Item.index; } Tardis.UsageData.addPageEntry(str); } function onItemExit() { Tardis.debug.addProcess("clickMainNav","Tardis : onItemExit()"); if(LastSection != null) { LastSection = null; sectionExit(); } else { itemLoad(); } } function maskShow() { this.attachMovie("clp_fullscreen_mask","mask",Tardis.depth++); TardisInterface.disable(); } function maskHide() { mask.removeMovieClip(); TardisInterface.enable(); } findAndReplace = function(strStr, strSearch, strReplace) { var i = 0; var l = strStr.length; var strTemp; while(i < l) { if(strStr.charAt(i) == strSearch) { strTemp += strReplace; } else { strTemp += strStr.charAt(i); } i++; } return strTemp; }; bottomNav.onOver = function(strID) { with(Tardis) { SFX.play("NavOver"); if(ActiveSection == null) { splash.pauseAt(strID); } } }; bottomNav.onOut = function() { with(Tardis) { if(ActiveSection == null) { splash.resume(); } } }; bottomNav.onUp = function(strID) { Tardis.debug.addProcess("clickMainNav","Tardis : bottomNav : onUp()"); with(Tardis) { if(splash.onAnimationEnd != null && ActiveSection != null) { bottomNav.setActive(ActiveSection.id); Tardis.debug.addProcess("clickMainNav","Tardis : bottomNav : onUp() : setActive : " + ActiveSection.id); return undefined; } SFX.play("NavClick"); var blnAtFirstSplash = ActiveSection == null; LastSection = ActiveSection; ActiveSection = Tardis.Sections[strID]; if(blnAtFirstSplash) { Tardis.debug.addProcess("clickMainNav","Tardis : bottomNav : onUp() : blnAtFirstSplash : " + blnAtFirstSplash); if(PLAY_MODE != "browser") { Tardis.debug.addProcess("clickMainNav","Tardis : bottomNav : onUp() : adding splash callback (onAnimationEnd())"); splash.onAnimationEnd = function() { this.endSoundLoop(); this.onAnimationEnd = null; this.clearUp(); this.blnAtStart = true; Tardis.sectionGo(); Tardis.debug.addProcess("clickMainNav","Tardis : splash : onAnimationEnd() : now calling Tardis.sectionGo()"); }; splash.resume(); } else { mc_browser_msg.unloadMovie(); splash.blnAtStart = true; } } else { Tardis.debug.addProcess("clickMainNav","Tardis : bottomNav : onUp() : blnAtFirstSplash : " + blnAtFirstSplash); Tardis.debug.addProcess("clickMainNav","Tardis : bottomNav : onUp() : strID : " + strID); if(strID != LastSection.id) { if(LastSection.type != "bespoke") { LastItem = ActiveItem; } header.go(strID); Tardis.debug.addProcess("clickMainNav","Tardis : bottomNav : onUp() : calling itemExit()"); itemExit(); } else { if(LastSection.type != "bespoke") { Tardis.debug.addProcess("clickMainNav","PATH ENDS PREMATURELY HERE"); Tardis.debug.showProcessPath("clickMainNav"); if(ActiveItem != sideMenu.ItemHome) { itemGo(sideMenu.ItemHome); } } LastSection = null; } } } };